package cn.iocoder.yudao.module.nmkj.dal.mysql.culture;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.nmkj.dal.dataobject.culture.CultureDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.nmkj.controller.admin.culture.vo.*;

/**
 * 企业文化 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CultureMapper extends BaseMapperX<CultureDO> {

    default PageResult<CultureDO> selectPage(CulturePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CultureDO>()
                .eqIfPresent(CultureDO::getImg, reqVO.getImg())
                .eqIfPresent(CultureDO::getContent, reqVO.getContent())
                .eqIfPresent(CultureDO::getSort, reqVO.getSort())
                .eqIfPresent(CultureDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(CultureDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CultureDO::getStatus)
                .orderByDesc(CultureDO::getSort));
    }

    default List<CultureDO> selectList(CulturePageReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<CultureDO>()
                .eqIfPresent(CultureDO::getImg, reqVO.getImg())
                .eqIfPresent(CultureDO::getContent, reqVO.getContent())
                .eqIfPresent(CultureDO::getSort, reqVO.getSort())
                .eqIfPresent(CultureDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(CultureDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CultureDO::getStatus)
                .orderByDesc(CultureDO::getSort));
    }

}